package com.pioneer.web.purchase.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.pioneer.common.core.domain.BaseEntity;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * PurPlan 采购计划表
 *
 * @author hlm
 * @date 2025-03-25 09:03:41
 */
@EqualsAndHashCode(callSuper = true)
@TableName(value = "pur_plan")
@Data
public class PurPlan extends BaseEntity {

    /**
     * 采购计划ID
     */
    @TableId(type = IdType.AUTO)
    private Long planId;

    /**
     * 采购计划编号
     */
    @TableField(condition = SqlCondition.LIKE)
    private String planCode;

    /**
     * 采购计划名称
     */
    @NotBlank(message = "计划名称不能为空")
    @TableField(condition = SqlCondition.LIKE)
    private String planName;

    /**
     * 总额
     */
    private BigDecimal total;

    /**
     * 计划状态
     */
    private String approveStatus;

    /**
     * 审批人
     */
    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private String approver;

    /**
     * 审批时间
     */
    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private LocalDateTime approveTime;

    /**
     * 审批意见
     */
    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private String approveOpinion;

    /**
     * 审批结果：通过(pass)、不通过(notPass)、驳回(reject)
     */
    @TableField(exist = false)
    private String approveResult;

    /**
     * 采购计划子信息集合
     */
    @TableField(exist = false)
    private List<PurPlanBody> planBodyList;
}
